<!-- transacoes/_form -->
<fieldset>
	<%= form.hidden_field :conta_id, :value => params[:conta_id] if params[:conta_id] %>

	<% unless params[:conta_id] %>
		<div>
			<%= form.label :conta, :class => "obrigatorio" %>
			<%= collection_select :transacao, :conta_id, current_usuario.contas_ativas, :id, :nome, :prompt => true %>
		</div>
	<% end %>

	<div>
		<%= form.label :data, :class => "obrigatorio" %>
		<%= form.text_field :data, :class => "datepicker", :value => form.object.data.strftime("%d/%m/%Y") %>
	</div>

	<div>
		<%= form.label :valor, :class => "obrigatorio" %>
		<%= form.text_field :valor, :class => "valor", :autocomplete => "off" %>
	</div>

	<div>
		<%= form.label :tipo, :class => "obrigatorio" %>
		<%= collection_select :transacao, :tipo, TipoTransacao.tipos_transacao, :id, :descricao, :prompt => true %>
	</div>

	<div>
		<%= form.label :observacao %>
		<%= form.text_area :observacao, :rows => 6, :class => "span6" %>
	</div>

	<div>
		<%= form.submit "Salvar", :class => "btn btn-primary" %>
		<%= link_to "Voltar", :back %>
	</div>
</fieldset>
